﻿@model IEnumerable<CardInChina.Data.Entity.Entity.Game>
@{
    int gameCount = Model.Count();
    int i = 0;
}
<div class="game_area tab_content" id="tab1">
    <div class="game_area_bgT">
    </div>
    <div class="game_area_bg">
        <div class="hot_game_area_img">
            <ul>
                @for (; i < gameCount && i < 5; i++)
                {
                    string photo;
                    photo = Model.ElementAt(i).GamePhoto;
                     <li>
                        @if (!string.IsNullOrEmpty(photo))
                        {
                            <a href="@Url.Action("Index", "Game", new { gameKey = Model.ElementAt(i).GameKey }, null)">
                            <img src="/content/images/photo/@photo" /></a>
                        }
                        else
                        {
                            <a href="@Url.Action("Index", "Game", new { gameKey = Model.ElementAt(i).GameKey }, null)">
                             <img src="/content/images/ss.gif" /></a>
                        }
                        <br />
                        @Html.ActionLink(Model.ElementAt(i).GameName, "Index", "Game", new { gameKey = Model.ElementAt(i).GameKey }, null)
                     </li>
                }
            </ul>
        </div>
        <div>
            <p class="hot_more_ui ui-icons">
            </p>
        </div>
        <div class="hot_game_area_list">

            @for (; i < gameCount; i++)
            {
                    <ul>
                        @for (int l = i; l < gameCount && l < i + 6; l++, i++)
                        {
                            <li>·
                                @Html.ActionLink(Model.ElementAt(i).GameName,
                                    "Index",
                                    "Game",
                                     new { gameKey = Model.ElementAt(i).GameKey },
                                    new { title = Model.ElementAt(i).GameName })
@*                                    <i class="mr ui-icons"></i>*@
                            </li>
                                
                        }
                    </ul>
                    }
        </div>
    </div>
    <div class="game_area_bgD">
    </div>
</div>
